<template>
  <!-- 资料卡片 组件 -->
  <div class="P_item_box" @click="handleToZipPage">
    <!-- left -->
    <div class="itemImg">
      <img src="@/assets/imge/defeat_img.png" alt="tp" />
    </div>
    <!-- right -->
    <div class="itemTiter">
      <p>山东2022年安工学习资料包.zip</p>
      <div class="down_row">
        <div class="left"><span>4.2MB</span></div>
        <div class="right">免费下载</div>
      </div>
    </div>
  </div>
</template>

<script>
import { useRouter } from "vue-router";
export default {
  props: {
    profileType: {
      type: String,
      default: "zip",
    },
    // 暂时的
    id: {
      type: Number,
      default: 0,
    },
  },
  setup(props) {
    const router = useRouter();
    const handleToZipPage = () => {
      if (props.profileType === "zip") {
        router.push(`/profileMe/${props.id}`);
      }
    };
    return { handleToZipPage };
  },
};
</script>

<style lang="less" scoped>
.P_item_box {
  width: 100%;
  height: 6.5rem;
  padding: 0.8rem;
  margin: 1rem 0;
  border-radius: 0.3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  box-shadow: 0px 0px 7px 0px #e6e6e6;
  .itemImg {
    width: 5rem;
    height: 5rem;
    text-align: center;
    border-radius: 0.3rem;
    overflow: hidden;
    // border: 1px solid #e9e9e9;
    img {
      width: 100%;
      height: 100%;
    }
  }
  .itemTiter {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-left: 0.5rem;
    box-sizing: border-box;
    p {
      width: 100%;
      margin: 0;
      color: #2a2929;
      padding: 0;
      font-size: 0.88rem;
      font-weight: bold;
      box-sizing: border-box;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
      word-break: break-all;
    }
    .down_row {
      display: flex;
      justify-content: space-between;
      flex: 1;
      align-items: center;
      .left {
        span {
          text-align: left;
          font-size: 0.8rem;
          color: #686868;
        }
      }
      .right {
        padding: 0.35rem 1rem;
        border-radius: 1rem;
        font-size: 1rem;
        font-weight: bold;
        letter-spacing: 0.15rem;
        color: red;
        background: rgb(255 234 232);
      }
    }
  }
}
</style>
